# App Module 
cmake_minimum_required(VERSION 3.16)

# 收集C++源文件
file(GLOB_RECURSE APP_SOURCES "*.cpp")
file(GLOB_RECURSE APP_HEADERS "*.h")

# 使用现代的qt_add_executable方式创建可执行文件
qt_add_executable(app
    ${APP_SOURCES}
    ${APP_HEADERS}
    # 添加资源文件
    ${CMAKE_SOURCE_DIR}/resources/icons.qrc
)

# 设置包含目录
target_include_directories(app PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_SOURCE_DIR}/src
)

# 链接必要的库
target_link_libraries(app PRIVATE
    Qt6::Core
    Qt6::Quick
    Qt6::QuickControls2
    agv_system_lib  # 链接src构建的库
)


# 设置可执行文件属性
set_target_properties(app PROPERTIES
    MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
    MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
    MACOSX_BUNDLE TRUE
    WIN32_EXECUTABLE FALSE  # 设置为FALSE以显示控制台窗口
)
